import {request} from "./request";
import {post, uploadFileRequest} from "@/utils/requests/requests";

// 添加协议
// export function addAgreementRequest(agreementInfo) {
//     return request({
//         url: '/admin/agreement/createAgreement',
//         method: 'post',
//         data: {...agreementInfo}
//     })
// }

// 添加协议
export function uploadAgreementPdf({name,type,file,description}){
    const data = new FormData()
    data.append("name",name)
    data.append("type",type)
    data.append("file",file)
    data.append("description",description)
    return uploadFileRequest( "/admin/agreement/createAgreement",data)
}

//获取协议列表
export function getAgreementList() {
    return post({
        url: '/admin/agreement/getAgreementList',
    })
}

//删除协议
export function removeAgreementByIdRequest(agreementId) {
    return post({
        url: `/admin/agreement/delAgreement/${agreementId}`,
    })
}